import request from '@/utils/request'

export function getInfo(query) {
  return request({
    url: '/mopbomcal/page',
    method: 'get',
    params: query
  })
}

export function add(data) {
  return request({
    url: '/mopbomcal',
    method: 'post',
    data
  })
}

export function update(id, data) {
  return request({
    url: `/mopbomcal/${id}`,
    method: 'put',
    data
  })
}

export function deleteInfo(id) {
  return request({
    url: `/mopbomcal/${id}`,
    method: 'delete'
  })
}

export function deleteAll() {
  return request({
    url: '/mopbomcal/all',
    method: 'delete'
  })
}

export function excelImport(file) {
  return request({
    url: '/mopMaterial/pAndMImport',
    method: 'post',
    data: file
  })
}

export function insertByProductNo(data) {
  return request({
    url: '/yxk/bom/insertByProductNo',
    method: 'get',
    params: data
  })
}
